package com.zx.crowdfunding.mapper;

import com.zx.crowdfunding.entity.Menu;
import com.zx.crowdfunding.entity.MenuExample;

import java.util.List;

import org.apache.ibatis.annotations.Param;

public interface MenuMapper {
    int countByExample(MenuExample example);

    int deleteByExample(MenuExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Menu record);

    int insertSelective(Menu record);

    List<Menu> selectByExample(MenuExample example);

    Menu selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Menu record, @Param("example") MenuExample example);

    int updateByExample(@Param("record") Menu record, @Param("example") MenuExample example);

    int updateByPrimaryKeySelective(Menu record);

    int updateByPrimaryKey(Menu record);

    /**
	 * 根据菜单id删除菜单与权限的关联关系数据
	 * @param menuId 菜单id
	 */
	void deleteMenuAuthRelationship(Integer menuId);

	/**
	 * 添加菜单与权限的关联关系数据
	 * @param menuId 菜单id
	 * @param authIdList 权限id的List集合
	 */
	void insertMenuAuthRelationship(@Param("menuId") Integer menuId, @Param("authIdList") List<Integer> authIdList);

	/** 
	 * 根据管理员id查询菜单
	 * @param adminId 管理员id
	 * @return 菜单对象的List集合
	 */
	List<Menu> selectMenuByAdminId(Integer adminId);
}